Skip to content

Conversation

@BmnQuentin
Copy link

Integrated pydantic logic to IntegerField.
All tests pass (apart from 5 console ones not related to modifications)
Fixed a few issued:

  • examples should enable Any type, not only strings
  • descriptor was broken during the merge of two kinds

@BmnQuentin
Copy link
Author

TODO: if the global idea is ok, move each class from field_descriptor in its own file (eg boolean.py)

Copy link
Collaborator

@pierrecamilleri pierrecamilleri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(apart from 5 console ones not related to modifications)

Were they already failing before ? Even on master branch ?
(normaly CI was passing not so long ago, however I have not investigated CI breaking in #1758 yet)


# Process the cell (remove non-digit characters if bare_number is False)
if not self.bare_number:
pattern = re.compile(r"((^[^-\d]*)|(\D*$))")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read value will be used once for each row, for performance reasons it would be useful to compile the regex outside of the function.

## Field._descriptor properties
descr = {**descr, **super().to_descriptor(validate=validate)}
## Merge descriptor_descr into base_descr to preserve base order
descr = {**base_descr, **descriptor_descr}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If changing the order, the above comment needs to be updated ("_descriptor" has priority)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants